<?php

namespace Org\Swoole;
class Swoole{


    public $post;

    public function  __construct($data)
    {
        $this->post = $data;
     
    }

    public function data(){

        $client = new swoole_client(SWOOLE_SOCK_TCP, SWOOLE_SOCK_SYNC);


        $client->connect('127.0.0.1', 9505) || exit("connect failed. Error: {$client->errCode}\n");

        //发送数据
        $client->send($this->post);

        $response = $client->recv();

        return $response;
    }

}